from common.basedriver import BaseDriver
from selenium.webdriver.support.wait import WebDriverWait

#给每个定位方法添加一个等待的装饰器

def decorator(driver=BaseDriver.driver):
    def realDecorator(func):
        def onCall(*args):
            try:
                return WebDriverWait(driver,10,0.5).until(func)
            except:
                print("元素没有找到")
                return False
        return onCall
    return realDecorator